See stationmap.R (lots of packages there’s no need to call for the other figures).
For this I use the package DiagrammR, intending to show how the different data types flow into each other for assessment.
## Linking to librsvg 2.57.0
##Figure 2: map The bathymetry file is too large to include in this repo, and the mapping packages are somewhat specific, but let me know if you’d like it and I will send you the relevant files and code!
Figure 3 represents combined time series of Alexandrium 18s, saxitoxin, Pseudo-nitzschia 18s, domoic acid, and chl-a concentration, for general time series view of the data
## png
## 2
Figure 4 compares toxin concentration to qPCR counts/mL of matched peterson stations
## Estimating learning rate. Each dot corresponds to a loss evaluation.
## qu = 0.75........done
## Estimating learning rate. Each dot corresponds to a loss evaluation.
## qu = 0.9........done
## png
## 2
Figure 5 compares toxin concentration to 18S of matched peterson stations. It proceeds to bootstrap 1000x, and extracts the 95th and 5th percentiles of at each chlorophyll value from the bootstrapped CPAs to represent the confidence interval
## png
## 2
## png
## 2
This section takes a subset of taxa from the previous plot and then creates a combined CPA, in this case looking at the likelihood of Dinophysis OR Alexandrium or Heterosigma exceeding their respective threshold relative abundances. I also include a couple methods of identifying inflections in the data: one is a changepoint analysis using the EnvCPT package, using a technique similar to ARIMA to identify inflections. The other is a GAM fit to the CPA data, then isolating the instantaneous change of the GAM function using a function called “derivatives” from the gratia package. It allows us to see what parts of the distribution are associated with greater change in likelihood.
## | | | 0% | |====== | 8% | |============ | 17% | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17% | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17% | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25% | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## | | | 0% | |====== | 8% | |============ | 17%Error in arima(data, order = c(1, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |================== | 25%Error in arima(data, order = c(2, 0, 0), method = "CSS-ML") :
## non-stationary AR part from CSS
## | |======================= | 33% | |============================= | 42% | |=================================== | 50% | |========================================= | 58% | |=============================================== | 67% | |==================================================== | 75% | |========================================================== | 83% | |================================================================ | 92% | |======================================================================| 100%
## png
## 2
Figure S1 compares microscopy and qPCR values to the 18S data
## png
## 2
Figure S3 shows how toxin concentrations vary by season
## # A tibble: 849 × 15
## # Groups: Date, SiteCode2, toxin [849]
## Date Year Month DOY SiteCode2 Region toxin value value2 detect
## <date> <chr> <ord> <date> <chr> <chr> <chr> <dbl> <dbl> <chr>
## 1 2015-10-28 2015 Oct 1904-10-28 PSP Centra… STX -88 0 Non-d…
## 2 2015-10-28 2015 Oct 1904-10-28 LL Centra… STX 11.5 11.5 Detec…
## 3 2015-10-28 2015 Oct 1904-10-28 RB Centra… STX -88 0 Non-d…
## 4 2015-10-28 2015 Oct 1904-10-28 RW South … STX -88 0 Non-d…
## 5 2015-10-28 2015 Oct 1904-10-28 OP South … STX -88 0 Non-d…
## 6 2015-10-28 2015 Oct 1904-10-28 CP South … STX -88 0 Non-d…
## 7 2015-10-28 2015 Oct 1904-10-28 TI Centra… STX -88 0 Non-d…
## 8 2015-10-28 2015 Oct 1904-10-28 BI South … STX -88 0 Non-d…
## 9 2015-10-28 2015 Oct 1904-10-28 EM Centra… STX -88 0 Non-d…
## 10 2015-12-14 2015 Dec 1904-12-14 TM Centra… STX -88 0 Non-d…
## # ℹ 839 more rows
## # ℹ 5 more variables: HighCount <chr>, Presence <chr>, Dayofyear <int>,
## # Subembayment <chr>, NearestPeterson <chr>
## # A tibble: 849 × 15
## # Groups: Date, SiteCode2, toxin [849]
## Date Year Month DOY SiteCode2 Region toxin value value2 detect
## <date> <chr> <ord> <date> <chr> <chr> <chr> <dbl> <dbl> <chr>
## 1 2015-10-28 2015 Oct 1904-10-28 PSP Centra… STX -88 0 Non-d…
## 2 2015-10-28 2015 Oct 1904-10-28 LL Centra… STX 11.5 11.5 Detec…
## 3 2015-10-28 2015 Oct 1904-10-28 RB Centra… STX -88 0 Non-d…
## 4 2015-10-28 2015 Oct 1904-10-28 RW South … STX -88 0 Non-d…
## 5 2015-10-28 2015 Oct 1904-10-28 OP South … STX -88 0 Non-d…
## 6 2015-10-28 2015 Oct 1904-10-28 CP South … STX -88 0 Non-d…
## 7 2015-10-28 2015 Oct 1904-10-28 TI Centra… STX -88 0 Non-d…
## 8 2015-10-28 2015 Oct 1904-10-28 BI South … STX -88 0 Non-d…
## 9 2015-10-28 2015 Oct 1904-10-28 EM Centra… STX -88 0 Non-d…
## 10 2015-12-14 2015 Dec 1904-12-14 TM Centra… STX -88 0 Non-d…
## # ℹ 839 more rows
## # ℹ 5 more variables: HighCount <chr>, Presence <chr>, Dayofyear <int>,
## # Subembayment <chr>, NearestPeterson <chr>
## png
## 2
## png
## 2